<?php
#□■□■□■□■□■□■□■□■□■□■□
#■ 	-    BR ATTACK PROGRAM    - 	 ■
#□ 									 □
#■ 		  サブルーチン一覧  		 ■
#□ 									 □
#■ ATTJYO		-		譲渡処理		 ■
#□ ATTACK		-		先制攻撃表示	 □
#□■□■□■□■□■□■□■□■□■□■□
#=============#
# ■ 譲渡処理 #
#=============#
function ATTJYO(){
global $in;

global $teamID,$w_teamID,$teamPass,$w_teamPass,$log,$w_f_name,$w_l_name,$w_cl,$w_sex,$w_no;
if(($teamID != '无 ')&&($teamID != '')&&($teamID == $w_teamID)&&($teamPass == $w_teamPass)){
	$log .= $w_f_name.' '.$w_l_name.'（'.$w_cl.' '.$w_sex.$w_no.'号）发现！<br>';
	$log .= $w_l_name.' 转让什么呢?。<br>';
	$in['Command']='ITEMJOUTO';
}else{ERROR('非正常访问','队名与密码不符','ATT_ETC',__FUNCTION__,__LINE__);}
}
#=================#
# ■ 先制攻撃表示 #
#=================#
function ATTACK(){
global $in;

global $kiri,$log,$w_f_name,$w_l_name,$w_cl,$w_sex,$w_no,$w_id,$wether;
if($kiri){
	$log .= '发现了人影！<br>';
	$log .= '但是，'.$wether.'的关系看不清楚是谁。<br>';
	$log .= '对方好像没有注意到这边的样子…。<br>';
	$in['Command']=('BATTLE0_'.IDcrypt($w_id));
}else{
	$log .= $w_f_name.' '.$w_l_name.'（'.$w_cl.' '.$w_sex.$w_no.'号）发现！<br>';
	$log .= $w_f_name.' '.$w_l_name.' 没有注意这边啊…。<br>';
	$in['Command']=('BATTLE0_'.IDcrypt($w_id));
}
}
#===============#
# ■ 戦利品取得 #
#===============#
function WINGET(){
global $in,$pref;

global $item,$id,$log,$eff,$itai,$l_name;
$money_get = 0;

$itno = -1;
for ($i=0;$i<5;$i++){if($item[$i] == '无'){$itno = $i;}}

if($in['WId'] == IDcrypt($id)){$log .= '自己试着夺走自己的道具。<br>空虚啊…。<br>';$in['Command'] = 'MAIN';return;}

$wk = $in['Command'];
$wk = preg_replace('/GET_/','',$wk);
$wk += 0;
$wk = (int)($wk);

$userlist = @file($pref['user_file']) or ERROR('无法打开文件 user_file','','ATT_ETC',__FUNCTION__,__LINE__);
$wingetchk=1;

global $w_id,$w_password,$w_f_name,$w_l_name,$w_sex,$w_cl,$w_no,$w_endtime,$w_att,$w_def,$w_hit,$w_mhit,$w_level,$w_exp,$w_sta,$w_wep,$w_watt,$w_wtai,$w_bou,$w_bdef,$w_btai,$w_bou_h,$w_bdef_h,$w_btai_h,$w_bou_f,$w_bdef_f,$w_btai_f,$w_bou_a,$w_bdef_a,$w_btai_a,$w_tactics,$w_death,$w_msg,$w_sts,$w_pls,$w_kill,$w_icon,$w_item,$w_eff,$w_itai,$w_log,$w_com,$w_dmes,$w_bid,$w_club,$w_money,$w_wp,$w_wg,$w_wn,$w_wc,$w_wd,$w_comm,$w_limit,$w_bb,$w_inf,$w_ousen,$w_seikaku,$w_sinri,$w_item_get,$w_eff_get,$w_itai_get,$w_teamID,$w_teamPass,$w_IP;
for ($i=0;$i<count($userlist);$i++){
	list($w_id,$w_password,$w_f_name,$w_l_name,$w_sex,$w_cl,$w_no,$w_endtime,$w_att,$w_def,$w_hit,$w_mhit,$w_level,$w_exp,$w_sta,$w_wep,$w_watt,$w_wtai,$w_bou,$w_bdef,$w_btai,$w_bou_h,$w_bdef_h,$w_btai_h,$w_bou_f,$w_bdef_f,$w_btai_f,$w_bou_a,$w_bdef_a,$w_btai_a,$w_tactics,$w_death,$w_msg,$w_sts,$w_pls,$w_kill,$w_icon,$w_item[0],$w_eff[0],$w_itai[0],$w_item[1],$w_eff[1],$w_itai[1],$w_item[2],$w_eff[2],$w_itai[2],$w_item[3],$w_eff[3],$w_itai[3],$w_item[4],$w_eff[4],$w_itai[4],$w_item[5],$w_eff[5],$w_itai[5],$w_log,$w_com,$w_dmes,$w_bid,$w_club,$w_money,$w_wp,$w_wg,$w_wn,$w_wc,$w_wd,$w_comm,$w_limit,$w_bb,$w_inf,$w_ousen,$w_seikaku,$w_sinri,$w_item_get,$w_eff_get,$w_itai_get,$w_teamID,$w_teamPass,$w_IP,) = explode(",",$userlist[$i]);
	if($in['WId'] == IDcrypt($w_id)){
		list($w_id,$w_password,$w_f_name,$w_l_name,$w_sex,$w_cl,$w_no,$w_endtime,$w_att,$w_def,$w_hit,$w_mhit,$w_level,$w_exp,$w_sta,$w_wep,$w_watt,$w_wtai,$w_bou,$w_bdef,$w_btai,$w_bou_h,$w_bdef_h,$w_btai_h,$w_bou_f,$w_bdef_f,$w_btai_f,$w_bou_a,$w_bdef_a,$w_btai_a,$w_tactics,$w_death,$w_msg,$w_sts,$w_pls,$w_kill,$w_icon,$w_item[0],$w_eff[0],$w_itai[0],$w_item[1],$w_eff[1],$w_itai[1],$w_item[2],$w_eff[2],$w_itai[2],$w_item[3],$w_eff[3],$w_itai[3],$w_item[4],$w_eff[4],$w_itai[4],$w_item[5],$w_eff[5],$w_itai[5],$w_log,$w_com,$w_dmes,$w_bid,$w_club,$w_money,$w_wp,$w_wg,$w_wn,$w_wc,$w_wd,$w_comm,$w_limit,$w_bb,$w_inf,$w_ousen,$w_seikaku,$w_sinri,$w_item_get,$w_eff_get,$w_itai_get,$w_teamID,$w_teamPass,$w_IP,) = explode(",",$userlist[$i]);
		BB_CK();#ブラウザバック対処
		if		($w_hit>0)	{$log .= $w_f_name.' 的那个道具看上去非常想要。<br>空虚啊…。<br>';$in['Command'] = 'MAIN';return;}
		elseif	($wk == 6)	{list($witem,$weff,$witai) = array($w_wep,$w_watt,$w_wtai);$w_wep = '空手<>WP';$w_watt = 0;$w_wtai = '∞';}
		elseif	($wk == 7)	{list($witem,$weff,$witai) = array($w_bou,$w_bdef,$w_btai);$w_bou = '内衣<>DN';$w_bdef = 0;$w_btai = '∞';}
		elseif	($wk == 8)	{list($witem,$weff,$witai) = array($w_bou_h,$w_bdef_h,$w_btai_h);$w_bou_h = '无';$w_bdef_h = $w_btai_h = 0;}
		elseif	($wk == 9)	{list($witem,$weff,$witai) = array($w_bou_f,$w_bdef_f,$w_btai_f);$w_bou_f = '无';$w_bdef_f = $w_btai_f = 0;}
		elseif	($wk == 10)	{list($witem,$weff,$witai) = array($w_bou_a,$w_bdef_a,$w_btai_a);$w_bou_a = '无';$w_bdef_a = $w_btai_a = 0;}
		elseif	($wk == 11)	{$money_get = 1;}
		else				{list($witem,$weff,$witai) = array($w_item[$wk],$w_eff[$wk],$w_itai[$wk]);$w_item[$wk] = '无';$w_eff[$wk] = $w_itai[$wk] = 0;}
		$wingetchk=0;break;
	}
}

$in['Command'] = 'MAIN';
if($wingetchk){
	ERROR('内部错误请向馆里猿提交错误报告','WINGET INTERNAL ERROR','ATT_ETC',__FUNCTION__,__LINE__);
}elseif($money_get){#現金取得
	global $money;
	$money_disp =($w_money * $pref['money_base']);
	$money+=$w_money;$w_money=0;
	$log .= $l_name.' 得到了 '.$money_disp.'元。<BR>';
}elseif($itno == -1){#持ち物空き无
	global $item_get,$eff_get,$itai_get;
	$item_get = $witem;$eff_get = $weff;$itai_get = $witai;
	$in['Command3'] = 'GET';$in['Command'] = 'ITMAIN';
}elseif((!preg_match('/^(无|空手|内衣)$/',$witem))&&($i != count($userlist))){#アイテム取得
	$item[$itno] = $witem;
	$eff[$itno] = $weff;$itai[$itno] = $witai;
	list($witem) = explode('<>',$witem,2);
	$log .= $l_name.' 得到了 '.$witem.' 。<BR>';
}else{$log .= '放弃掠夺了。<BR>';}
SAVE();
SAVE2();
}
#=================#
# ■ 死体発見処理 #
#=================#
function DEATHGET(){
global $in;

global $log,$w_f_name,$w_l_name,$w_id,$w_death,$chksts;

$log .= $w_f_name.' '.$w_l_name.'的菊爆现场被找到了。<br>';
$item_get = $w_id;#ブラウザバック対処

if(preg_match('/刀/',$w_death)){
	if	 ($w_com == 0)	{$log .= '头部只有皮还连在身上…。被斩首了么。<br>';}
	elseif($w_com == 1)	{$log .= '腹部被锐利的刀具切开，内脏都跑了出来…。<br>';}
	elseif($w_com == 2)	{$log .= '从肩口到胸口的斩伤。斩得相当利落呢…。<br>';}
	elseif($w_com == 3)	{$log .= '被无法分尸了，这种事是人类做出来的么…。<br>';}
	elseif($w_com == 4)	{$log .= '脸被击中切割过了。生前的面容完全无法辨识…。<br>';}
	elseif($w_com == 5)	{$log .= '腹部被切开了，但仔细看手腕的切伤也非常多…。<BR>被对手斩后企图自杀吗？<br>';}
	else				{$log .= '从头到胸口被斩得血肉模糊…。<br>';}
}elseif(preg_match('/射/',$w_death)){
	if	 ($w_com == 0)	{$log .= '胸口…3发，额头1发弹痕。额头的一发是致命伤么…。<br>';}
	elseif($w_com == 1)	{$log .= '腹部有数发弹痕，血都已经流干了。<br>';}
	elseif($w_com == 2)	{$log .= '头部被打得不成人形…。名牌只能大概开清姓名。<br>';}
	elseif($w_com == 3)	{$log .= '胸口被打中数发。脑髓也被爆开。被杀后枪抵着咽喉开枪的吧，真是恶魔般的行径…。<br>';}
	elseif($w_com == 4)	{$log .= '腹部的洞能从这里看到那一头，这绝对活不成啊…。<br>';}
	elseif($w_com == 5)	{$log .= '脸上有着数发弹痕…。和这个人有仇么。<br>';}
	else				{$log .= '右头部受到激烈损伤，脑浆都喷了出来…。<br>';}
}elseif(preg_match('/火/',$w_death)){
	if	 ($w_com == 0)	{$log .= '被炸得四分五裂，真是精准的炸弹呢…。<br>';}
	elseif($w_com == 1)	{$log .= '双足被炸飞了。只凭着手臂想逃出这里么…。<br>';}
	elseif($w_com == 2)	{$log .= '被炸弹袭击了么，只剩下头部和右腕…。<br>';}
	elseif($w_com == 3)	{$log .= '被炸弹袭击了么，头掉在少了半边的身子里…。<br>';}
	elseif($w_com == 4)	{$log .= '被爆炸吹飞的手腕就落在5公分前的地方…。<br>';}
	elseif($w_com == 5)	{$log .= '说是尸体，不如说是肉块呐…。<br>';}
	else				{$log .= '除了头部和手就找不到了呢…。被爆风吹飞到哪里去了么…。<br>';}
}elseif(preg_match('/抚|瓣/',$w_death)){
	if	 ($w_com == 0)	{$log .= '被压迫腹部窒息而死的吗…。<br>';}
	elseif($w_com == 1)	{$log .= '被殴打得很惨呢，脸上青一块紫一块的…。<br>';}
	elseif($w_com == 2)	{$log .= '脖子被扭断，白骨从中穿刺而出…。<br>';}
	elseif($w_com == 3)	{$log .= '脸埋在地里，后脑被打变形了呢。<br>';}
	elseif($w_com == 4)	{$log .= '被从后方而来的钝器挥中，抱头而死的样子真寒酸…。<br>';}
	elseif($w_com == 5)	{$log .= '脑袋爆开，血浆四溅，从正面被砸中的吗…。<br>';}
	else				{$log .= '脑袋漂亮的弯向一边，像折断的百合花般美丽…。<br>';}
}elseif(preg_match('/毒/',$w_death)){
	if	 ($w_com == 0)	{$log .= '中毒了吧…？口吐白沫翻了白眼…。<br>';}
	elseif($w_com == 1)	{$log .= '口中渗出一条血河，估计是在睡着的时候离去的吧…。<br>';}
	elseif($w_com == 2)	{$log .= '靠竟尸体能闻到特有的药品味道。被毒杀了么…。<br>';}
	elseif($w_com == 3)	{$log .= '被毒杀了么，口中满出很多血泡。<br>';}
	elseif($w_com == 4)	{$log .= '中毒过重了么。自己抓破了喉咙…。<br>';}
	elseif($w_com == 5)	{$log .= '被谁下毒了么，皮肤都变颜色了…。<br>';}
	else				{$log .= '皮肤都变黑了，从口中喷出黑血…。<br>';}
} else					{$log .= '被菊爆在地…。<br>';}
$log .= '看看包包里有些什么吧…。<br>';
$in['Command'] = 'DEATHGET';

$chksts='OK';

}
?>